package com.lh.java.io;

import java.io.FileInputStream;
import java.io.FileOutputStream;

public class FileCopyUseFileInputStream {
	public static void main(String args[]) {

		FileInputStream fis = null;

		FileOutputStream fos = null;

		try {

			fis = new FileInputStream("c2.gif");

			fos = new FileOutputStream("c2_copy.gif");

			int c;

			while ((c = fis.read()) != -1)

				fos.write(c);

		} catch (Exception e) {

			e.printStackTrace();

		} finally {

			if (fis != null)
				try {
					fis.close();
				} catch (Exception e) {
					e.printStackTrace();
				}

			if (fos != null)
				try {
					fos.close();
				} catch (Exception e) {
					e.printStackTrace();
				}

		}
	}
}
